<extend name="Public:innerbase" />
<block name="js">
<include file="Public:upload" />
<script src="{:STATICS}/js/holder.min.js"></script>
</block>
<block name="content">
<div class="container-fluid">
	<div class="page-header wm-page-header">
		<h3>添加户型</h3>
	</div>
	<form class="form-horizontal" method="post" action="">
		<input type="hidden" name="id" value="{$housetype['id']}" />
		<div class="form-group">
			<label for="name" class="control-label col-sm-2">户型名称</label>
			<div class="col-md-4">
				<input type="text" id="name" name="name" value="{$housetype['name']}" class="form-control" />
			</div>
			<div class="col-md-2"> <span class="text-warning">尽量简单，不要超过20字</span></div>
		</div>
		<div class="form-group">
			<label for="son_id" class="control-label col-sm-2">所属楼盘</label>
			<div class="col-md-2">
				<select id="son_id" name="son_id" class="form-control" >                 
					<option value="0">请选择子楼盘</option>
					<volist name="son_data" id="vo">
					<option value="{$vo['sid']}" <if condition="$vo['sid'] eq $housetype['son_id']">selected="selected"</if>>{$vo['title']}</option>
					</volist>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label for="album_title" class="control-label col-sm-2">全景相册名称：</label>
			<div class="col-md-2">
				<select id="panorama_id" name="panorama_id" class="form-control" data-rule-required="true"> 
					<option value="0">请选择360全景相册</option> 
					<volist name="panorama" id="vo">
					<option value="{$vo['pid']}" <if condition="$vo['pid'] eq $housetype['panorama_id']">selected="selected"</if>>{$vo['name']}</option>
					</volist>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label for="floor_num" class="control-label col-sm-2">楼层</label>
			<div class="col-md-4">
				<input type="text" id="floor_num" name="floor_num" value="{$housetype['floor_num']}" class="form-control" />
			</div>
			<div class="col-md-2"><span class="text-warning">如：1-10</span></div>
		</div>
		<div class="form-group">
			<label for="floor_num" class="control-label col-sm-2">建筑面积</label>
			<div class="col-md-4">
				<input type="text" id="area" name="area" value="{$housetype['area']}" class="form-control" />
			</div>
			<div class="col-md-2"><span class="text-warning">如：约120平方米</span></div>
		</div>
		<div class="form-group">
			<label for="description" class="control-label col-sm-2">房屋户型</label>
			<div class="col-sm-2">
				<div class="input-group">
					<select id="fang" name="fang" class="form-control"> 
						<option value="1" <if condition="$housetype['fang'] eq 1">selected="selected"</if>>1</option>
						<option value="2" <if condition="$housetype['fang'] eq 2">selected="selected"</if>>2</option>
						<option value="3" <if condition="$housetype['fang'] eq 3">selected="selected"</if>>3</option>
						<option value="4" <if condition="$housetype['fang'] eq 4">selected="selected"</if>>4</option>
						<option value="5" <if condition="$housetype['fang'] eq 5">selected="selected"</if>>5</option>
						<option value="6" <if condition="$housetype['fang'] eq 6">selected="selected"</if>>6</option>
						<option value="7" <if condition="$housetype['fang'] eq 7">selected="selected"</if>>7</option>
					</select>
					<span class="input-group-addon">房</span>
				</div>
			</div>
			<div class="col-sm-2">
				<div class="input-group">
					<select id="ting" name="ting" class="form-control">     
						<option value="1" <if condition="$housetype['ting'] eq 1">selected="selected"</if>>1</option>  
						<option value="2" <if condition="$housetype['ting'] eq 2">selected="selected"</if>>2</option>
						<option value="3" <if condition="$housetype['ting'] eq 3">selected="selected"</if>>3</option>
						<option value="4" <if condition="$housetype['ting'] eq 4">selected="selected"</if>>4</option>
						<option value="5" <if condition="$housetype['ting'] eq 5">selected="selected"</if>>5</option>
						<option value="6" <if condition="$housetype['ting'] eq 6">selected="selected"</if>>6</option>
					</select>
					<span class="input-group-addon">厅</span>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label for="sort" class="control-label col-sm-2">显示顺序</label>
			<div class="col-md-4">
				<input type="text" id="sort" name="sort" value="{$housetype['sort']|default=1}" class="form-control" />
			</div>
			<div class="col-md-2"> <span class="text-warning">数值越大越靠前</span></div>
		</div>
		<div class="form-group">
			<label for="description" class="control-label col-sm-2">户型介绍</label>
			<div class="col-md-4">
				<textarea id="description" name="description" class='form-control'  placeholder="户型介绍简单明了就好" style="width:100%;height:125px">{$housetype['description']}</textarea>
			</div>
		</div>
		<div class="form-group">
			<label class="control-label col-sm-2">户型图片1</label>
			<div class="col-md-6">
				<img id="type1Holder" <if condition="$housetype['type1'] neq ''">src="{$housetype['type1']}"<else/>data-src="$holder.js/216x120/gray/text:720*400"</if>  style="width:216px;height:120px">
				<input type="hidden" name="type1" id="type1" class="form-control" value="{$housetype['type1']}" />
				<div class="btn-group" style="vertical-align:bottom;">
					<span class="btn btn-xs btn-primary" onclick="selectAsset('type1',720,400)">
						<span class="glyphicon glyphicon-cloud-upload"></span>选择
					</span>
					<span class="btn btn-primary btn-xs" onclick="previewImg('type1')">
						<span class="glyphicon glyphicon-picture"></span>预览
					</span>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="control-label col-sm-2">户型图片2</label>
			<div class="col-md-6">
				<img id="type2Holder" <if condition="$housetype['type2'] neq ''">src="{$housetype['type2']}"<else/>data-src="$holder.js/216x120/gray/text:720*400"</if>  style="width:216px;height:120px">
				<input type="hidden" name="type2" id="type2" class="form-control" value="{$housetype['type2']}">
				<div class="btn-group" style="vertical-align:bottom;">
					<span class="btn btn-xs btn-primary" onclick="selectAsset('type2',720,400)">
						<span class="glyphicon glyphicon-cloud-upload"></span>选择
					</span>
					<span class="btn btn-primary btn-xs" onclick="previewImg('type2')">
						<span class="glyphicon glyphicon-picture"></span>预览
					</span>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="control-label col-sm-2">户型图片3</label>
			<div class="col-md-6">
				<img id="type3Holder" <if condition="$housetype['type3'] neq ''">src="{$housetype['type3']}"<else/>data-src="$holder.js/216x120/gray/text:720*400"</if>  style="width:216px;height:120px">
				<input type="hidden" name="type3" id="type3" class="form-control" value="{$housetype['type3']}">
				<div class="btn-group" style="vertical-align:bottom;">
					<span class="btn btn-xs btn-primary" onclick="selectAsset('type3',720,400)">
						<span class="glyphicon glyphicon-cloud-upload"></span>选择
					</span>
					<span class="btn btn-primary btn-xs" onclick="previewImg('type3')">
						<span class="glyphicon glyphicon-picture"></span>预览
					</span>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="control-label col-sm-2">户型图片4</label>
			<div class="col-md-6">
				<img id="type4Holder" <if condition="$housetype['type4'] neq ''">src="{$housetype['type4']}"<else/>data-src="$holder.js/216x120/gray/text:720*400"</if>  style="width:216px;height:120px">
				<input type="hidden" name="type4" id="type4" class="form-control" value="{$housetype['type4']}">
				<div class="btn-group" style="vertical-align:bottom;">
					<span class="btn btn-xs btn-primary" onclick="selectAsset('type4',720,400)">
						<span class="glyphicon glyphicon-cloud-upload"></span>选择
					</span>
					<span class="btn btn-primary btn-xs" onclick="previewImg('type4')">
						<span class="glyphicon glyphicon-picture"></span>预览
					</span>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="col-md-4 col-sm-offset-2">
				<button type="submit" name="button" class="btn btn-primary">保存</button>
			</div>
		</div>
	</form>
</div>
</block>